<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学校半血条件报表情况</title>
<script type="text/javascript" src="/js/echarts.min.js"></script>
</head>
<body>
	<!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
	<center>
		<h2>办学条件报表</h2>
	</center>
	<div id="eatSeats" style="width: 500px; height: 300px;"></div>
	<div id="lBooks" style="width: 500px; height: 300px;"></div>
	<hr />
	<center>
		<h2>专业与课程建设报表</h2>
	</center>
	<div id="majorType" style="width: 500px; height: 300px;"></div>
	<div id="majors" style="width: 500px; height: 300px;"></div>
	<script type="text/javascript">
		var school = ${schoolmes};
		// 基于准备好的dom，初始化echarts实例
		var myChart = echarts.init(document.getElementById('eatSeats'));
		var lbookChart = echarts.init(document.getElementById('lBooks'));
		var str = (school.schools[0].sdate).split("-", 1);
		var mes = [ school.schools[0].eatSeats, school.schools[1].eatSeats,
				school.schools[2].eatSeats, school.schools[3].eatSeats,
				school.schools[4].eatSeats ];
		var sdate = [ (school.schools[0].sdate).split("-", 1),
				(school.schools[1].sdate).split("-", 1),
				(school.schools[2].sdate).split("-", 1),
				(school.schools[3].sdate).split("-", 1),
				(school.schools[4].sdate).split("-", 1) ]
		//图书馆书
		var mes2 = [ school.schools[0].lBooks, school.schools[1].lBooks,
				school.schools[2].lBooks, school.schools[3].lBooks,
				school.schools[4].lBooks ]
		//  指定图表的配置项和数据
		var eatSeats = {
			title : {
				text : '学生用餐座位数同年比较'
			},
			tooltip : {},
			legend : {
				data : [ '年份' ]
			},
			xAxis : {
				data : sdate
			},
			yAxis : {},
			series : [ {
				name : '学生用餐座位数',
				type : 'bar',
				data : mes
			} ]
		};

		var lBooks = {
			title : {
				text : '图书馆藏书数量同年比较'
			},
			tooltip : {},
			legend : {
				data : [ '年份' ]
			},
			xAxis : {
				data : sdate
			},
			yAxis : {},
			series : [ {
				name : '图书馆藏书数量',
				type : 'bar',
				data : mes2
			} ]
		};

		var majorType = echarts.init(document.getElementById('majorType'));
		var mdate = [ (school.majors[0].mdate).split("-", 1),
				(school.majors[1].mdate).split("-", 1),
				(school.majors[2].mdate).split("-", 1),
				(school.majors[3].mdate).split("-", 1),
				(school.majors[4].mdate).split("-", 1) ];
		var majorTypes = [ school.majors[0].majorType,
				school.majors[1].majorType, school.majors[2].majorType,
				school.majors[3].majorType, school.majors[4].majorType ]
		var majorTypee = {
			title : {
				text : '专业大类数同年比较'
			},
			tooltip : {},
			legend : {
				data : [ '年份' ]
			},
			xAxis : {
				data : mdate
			},
			yAxis : {},
			series : [ {
				name : '专业大类数',
				type : 'bar',
				data : majorTypes
			} ]
		};
		var majors = echarts.init(document.getElementById('majors'));
		var majorss = [ school.majors[0].majors, school.majors[1].majors,
				school.majors[2].majors, school.majors[3].majors,
				school.majors[4].majors ]
		var majorse = {
			title : {
				text : '专业大类数同年比较'
			},
			tooltip : {},
			legend : {
				data : [ '年份' ]
			},
			xAxis : {
				data : mdate
			},
			yAxis : {},
			series : [ {
				name : '专业大类数',
				type : 'bar',
				data : majorss
			} ]
		};
		//  使用刚指定的配置项和数据显示图表。
		myChart.setOption(eatSeats);
		lbookChart.setOption(lBooks);
		majorType.setOption(majorTypee);
		majors.setOption(majorse);
	</script>


</body>
</html>